<?php

return array(


    'view_manager' => array(
        'template_path_stack' => array(
            'products' => __DIR__ . '/../view',
        ),
    ),
    'controllers' => array(
        'invokables' => array(
            'products' => 'Products\Controller\ProductsController',
        ),
    ),
    'service_manager' => array(
        'aliases' => array(
            'user_zend_db_adapter' => 'Zend\Db\Adapter\Adapter',
            'translator' => 'MvcTranslator',
        ),
    ),
    'router' => array(
        'routes' => array(
            'products' => array(
                'type' => 'Literal',
                'priority' => 1000,
                'options' => array(
                    'route' => '/products',
                    'defaults' => array(
                        'controller' => 'products',
                        'action'     => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'default' => array(
                        'type'    => 'Segment',
                        'options' => array(
                            'route'    => '/[:controller[/:action[/:id]]]',
                            'constraints' => array(
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'id'     	 => '[a-zA-Z0-9_-]*',
                            ),
                            'defaults' => array(
                            ),
                        ),
                    ),
                ),
            ),
        ),
    ),

    'authorize' => array(
        'guards' => array(
            /*'Authorize\Guard\Controller' => array(
                array(
                    'controller' => array('Admin\Controller\AdminController'),
                    'action' => array('index'),
                    'roles' => array('admin')
                ),
                array(
                    'controller' => array('Admin\Controller\UserController'),
                    'action' => array('index','create','update','logout'),
                    'roles' => array('admin')
                ),
                array(
                    'controller' => array('Admin\Controller\UserController'),
                    'action' => array('login'),
                    'roles' => array('guest')
                ),
                array(
                    'controller' => array('user'),
                    'action' => array('index','logout'),
                    'roles' => array('user','admin')
                ),
                array(
                    'controller' => array('user'),
                    'action' => array('login','register'),
                    'roles' => array('guest')
                ),
            ),*/
            'Authorize\Guard\Route' => array(
                array('route' => 'products', 'roles' => array('guest' , 'user' , 'admin')),
            ),
        ),
    ),
);
